<template>
    <div>
        <div class="accountFun">
            <div class="accountFun-top">
                <el-form ref="form">
                    <el-form-item label="方案名称" label-width="90px" class="lf">
                        <el-input v-model="costName" style='width: 150px !important;' size="mini"></el-input>
                    </el-form-item>

                    <el-form-item label="附加方案" class="lf" label-width="120px">
                        <el-cascader size="mini" :options="sexOpt" v-model="sexModel"></el-cascader>
                    </el-form-item>

                    <el-form-item label="线路" label-width="80px" class="lf">
                        <el-cascader size="mini" :options="selectOpt" v-model="lineName"></el-cascader>
                    </el-form-item>

                    <el-form-item label="营运单位" label-width="230px" class="lf">
                        <el-cascader size="mini" :options="custOpt" v-model="custName"></el-cascader>
                    </el-form-item>


                    <el-form-item label="班次号" label-width="90px" class="lf">
                        <el-input v-model="className" style='width: 150px !important;' size="mini"></el-input>
                    </el-form-item>

                    <el-form-item label="车牌号" label-width="120px" class="lf">
                        <el-cascader size="mini" :options="cardOpt" v-model="cardName"></el-cascader>
                    </el-form-item>

                    <el-form-item label="费用名称" label-width="120px" class="lf">
                        <el-input v-model="feiyongName" style='width: 150px !important;' size="mini"></el-input>
                    </el-form-item>
                </el-form>
                <button class="check-btn rf" @click="searchBusList" style="width: 90px;margin-right: 30px;">
                    <img src="../../assets/imgs/operation_btn_icon_chaxun_default.png" alt="" class="btn-img">
                    查询
                </button>
            </div>

            <div class="accountFun-con">
                <el-row>
                    <el-col :span="24" class="table-fun" style="height: 45px;">
                        <img src="../../assets/imgs/operation_icon_shuaxin_default.png" alt="" class="lf">
                        <div class="lf choose-title fun-text" @click="allList">刷新</div>
                        <img src="../../assets/imgs/operation_icon_tianjia_default.png" alt="" class="lf">
                        <div class="lf choose-title fun-text" @click="addClass">添加</div>
                        <img src="../../assets/imgs/operation_icon_xiugai_default.png" alt="" class="lf">
                        <div class="lf choose-title fun-text" @click="showUpdateWin">修改</div>
                        <img src="../../assets/imgs/operation_icon_shanchu_default.png" alt="" class="lf">
                        <div class="lf choose-title fun-text" @click="deleteClass">删除</div>
                        <el-form>
                            <el-form-item label="日期段" label-width="100px" class="lf">
                                <el-cascader size="mini" :options="dateOpt" v-model="dateName"></el-cascader>
                            </el-form-item>
                        </el-form>
                        <el-form>
                            <el-form-item label="方案分类" label-width="140px" class="lf">
                                <el-cascader size="mini" :options="fangAn" v-model="fangClassify"></el-cascader>
                            </el-form-item>
                        </el-form>
                    </el-col>

                </el-row>
                <el-row class="lf" style="width: 100%;">
                    <el-col :span="24">
                        <avue-crud @current-change="rowChange" @current-row-change="curRChange" :data="objs"
                                   :page="page" :option="dataForm"></avue-crud>
                    </el-col>
                </el-row>
                <div class="closing-cost">
                    <div style="padding-left: 15px;">结算费用</div>
                    <el-col :span="24">
                        <avue-crud @current-row-change="jiesuanRChange" :data="costFruit" :page="feePage" :option="costForm"></avue-crud>
                    </el-col>
                </div>
            </div>
        </div>

        <!--添加 请选择 S-->
        <div class="addModal" v-if="addModal">
            <div class="left-choose lf" style="overflow: hidden;">
                <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt="" class="lf">
                <div class="lf title" style="color: #009688;padding-left: 10px;">添加</div>
            </div>
            <el-form ref="form" style="width:100%;overflow: hidden;">
                <el-form-item label="方案名称*" label-width="75px" class="lf" style="margin-left: 20px;">
                    <el-input title="必须填写" v-model="fangName" style='width: 120px !important;' size="mini"></el-input>
                    <el-button @click="searchCode" icon="el-icon-search" size="mini">提取已有方案</el-button>
                </el-form-item>
                <el-form-item label="线路" label-width="75px" class="lf">
                    <el-cascader size="mini" :options="selectOpt1" v-model="lineNames"></el-cascader>
                </el-form-item>

                <el-form-item label="启用*" label-width="95px" class="lf">
                    <el-cascader title="必须填写" size="mini" :options="qiyong" v-model="qiYong"></el-cascader>
                </el-form-item>
                <el-form-item label="附加方案*" label-width="95px" class="lf">
                    <el-cascader title="必须填写" size="mini" :options="addScheme" v-model="addSchemes"></el-cascader>
                </el-form-item>
                <el-form-item label="班次号" label-width="75px" class="lf" style="margin-left: 20px;">
                    <el-input v-model="classNum" style='width: 120px !important;' size="mini"></el-input>
                </el-form-item>
                <el-form-item label="车牌号" label-width="120px" class="lf">
                    <el-cascader size="mini" :options="cardOpt1" v-model="vehiNum"></el-cascader>
                </el-form-item>

                <el-form-item label="班次类型*" label-width="95px" class="lf">
                    <el-cascader title="必须填写" size="mini" :options="bustype" v-model="busType"></el-cascader>
                </el-form-item>
                <el-form-item label="结算方式*" label-width="95px" class="lf">
                    <el-cascader title="必须填写" size="mini" :options="balancetype" v-model="balanceType"></el-cascader>
                </el-form-item>
                <el-form-item label="分类" label-width="75px" class="lf" style="margin-left: 20px;">
                    <el-input v-model="addtype" style='width: 160px !important;' size="mini"></el-input>
                </el-form-item>
                <div style="overflow: hidden;line-height: 28px;" class="lf">
                    <span style="padding: 0 10px 0 20px;color: #606266;">有效日期</span>
                    <el-date-picker format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd" v-model="dateTo" size="mini"
                                    type="daterange" range-separator="至" start-placeholder="开始日期"
                                    end-placeholder="结束日期">
                    </el-date-picker>
                    <el-button @click="dateCode" icon="el-icon-search" size="mini"></el-button>
                </div>
                <el-form-item label="结算单位" label-width="75px" class="lf" style="margin-left: 20px;">
                    <el-input v-model="closingUnit" style='width: 200px !important;' size="mini"></el-input>
                    <el-button @click="yingCode" icon="el-icon-search" size="mini"></el-button>
                </el-form-item>
                <el-form-item label="营运单位" label-width="75px" class="lf" style="margin-left: 20px;width: 55%;">
                    <el-cascader size="mini" :options="custOpt1" v-model="operateUnit"></el-cascader>
                </el-form-item>

                <el-form-item label="备注" label-width="75px" class="lf" style="margin-left: 20px;">
                    <el-input v-model="remarks" style='width: 200px !important;' size="mini"></el-input>
                </el-form-item>
                <div class="scheme-priority lf">
                    <div>结算方案优先级：</div>
                    <div>班次类型>车牌号>营运单位>班次号>线路</div>
                </div>
            </el-form>
            <button class="check-btn rf" @click="addCancelBtn" style="width:90px;margin: 20px 10px 20px 0;">
                <img src="../../assets/imgs/operation_btn_icon_quxiao_default.png" alt="" class="btn-img">
                取消
            </button>
            <button class="check-btn rf" @click="addSureBtn" style="width:90px;margin: 20px 10px 20px 0;">
                <img src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">
                确定
            </button>
        </div>
        <div class="choose" v-if="choose">
            <div class="left-choose lf" style="overflow: hidden;">
                <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt="" class="lf">
                <div class="lf title" style="color: #009688;padding-left: 10px;">请选择</div>
            </div>
            <el-col :span="24">
                <div class="choose-box">
                    <el-form ref="form" style="width:100%;overflow: hidden;">
                        <el-form-item label="" class="lf" style="margin: 0 20px 0 0;">
                            <el-input v-model="fanganName" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 20px 0 0;">
                            <el-input v-model="fenlei" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 20px 0 0;">
                            <el-input v-model="classType" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 20px 0 0;">
                            <el-input v-model="lineNameM" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 20px 0 0;">
                            <el-input v-model="banciNum" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 20px 0 0;">
                            <el-input v-model="yunying" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 20px 0 0;">
                            <el-input v-model="cardNum" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 20px 0 0;">
                            <el-input v-model="youxiaoqi" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                    </el-form>
                </div>
                <avue-crud @current-change="chooseChange" @current-row-change="chooseRChange" :data="chooseFruit"
                           :page="choosePage" :option="chooseForm"></avue-crud>

            </el-col>
            <button class="check-btn rf" @click="del" type="button" style="width: 90px;">
                <img src="../../assets/imgs/operation_btn_icon_quxiao_default.png" alt="" class="btn-img">取消
            </button>
            <button class="check-btn rf" @click="delSureBtn" v-if="delBtn1">
                <img src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">
                确定
            </button>
            <button class="check-btn rf" @click="delSureBtn1" v-if="delBtn2">
                <img src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">
                确定
            </button>
        </div>
        <!--添加 请选择 E-->

        <!--修改弹窗 S-->
        <div class="addModal revise" v-if="revise">
            <div class="left-choose lf" style="overflow: hidden;">
                <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt="" class="lf">
                <div class="lf title" style="color: #009688;padding-left: 10px;">修改</div>
            </div>

            <!-- 左侧列表 S-->
            <div class="revise-left lf">
                <el-form ref="form" style="width:100%;overflow: hidden;">
                    <el-form-item label="方案名称*" label-width="75px" class="lf" style="margin-left: 20px;">
                        <el-input title="必须填写" v-model="fangName1" style='width: 120px !important;'
                                  size="mini"></el-input>
                        <el-button @click="searchCode1" icon="el-icon-search" size="mini"></el-button>
                    </el-form-item>
                 <!--   <el-form-item label="线路" label-width="75px" class="lf" style="margin-left: 20px;">
                        <el-input v-model="lineNames1" style='width: 120px !important;' size="mini"></el-input>
                    </el-form-item>-->
                    <el-form-item label="线路" label-width="75px" class="lf">
                        <el-cascader size="mini" :options="selectOpt2" v-model="lineNames1"></el-cascader>
                    </el-form-item>
                    <el-form-item label="启用*" label-width="95px" class="lf">
                        <el-cascader title="必须填写" size="mini" :options="qiyong1" v-model="qiYong1"></el-cascader>
                    </el-form-item>
                    <el-form-item label="附加方案*" label-width="95px" class="lf">
                        <el-cascader title="必须填写" size="mini" :options="addScheme" v-model="addSchemes1"></el-cascader>
                    </el-form-item>
                    <el-form-item label="班次号" label-width="75px" class="lf" style="margin-left: 20px;">
                        <el-input v-model="classNum1" style='width: 120px !important;' size="mini"></el-input>
                    </el-form-item>
                 <!--   <el-form-item label="车牌号" label-width="75px" class="lf" style="margin-left: 20px;">
                        <el-input v-model="vehiNum1" style='width: 120px !important;' size="mini"></el-input>
                    </el-form-item>-->
                    <el-form-item label="车牌号" label-width="120px" class="lf">
                        <el-cascader size="mini" :options="cardOpt2" v-model="vehiNum1"></el-cascader>
                    </el-form-item>

                    <el-form-item label="班次类型*" label-width="95px" class="lf">
                        <el-cascader title="必须填写" size="mini" :options="bustype1" v-model="busType1"></el-cascader>
                    </el-form-item>
                    <el-form-item label="结算方式*" label-width="95px" class="lf">
                        <el-cascader title="必须填写" size="mini" :options="balancetype1"
                                     v-model="balanceType1"></el-cascader>
                    </el-form-item>
                    <el-form-item label="分类" label-width="75px" class="lf" style="margin-left: 20px;">
                        <el-input v-model="addtype1" style='width: 160px !important;' size="mini"></el-input>
                    </el-form-item>
                    <div style="overflow: hidden;line-height: 28px;width: 75%;" class="lf">
                        <span style="padding: 0 10px 0 20px;color: #606266;">有效日期</span>
                        <el-date-picker v-model="dateTo1" size="mini" type="daterange" range-separator="至"
                                        start-placeholder="开始日期" end-placeholder="结束日期">
                        </el-date-picker>
                        <el-button @click="dateCode1" icon="el-icon-search" size="mini"></el-button>
                    </div>
                    <el-form-item label="结算单位" label-width="75px" class="lf" style="margin-left: 20px;">
                        <el-input v-model="closingUnit1" style='width: 200px !important;' size="mini"></el-input>
                        <el-button @click="yingCode1" icon="el-icon-search" size="mini"></el-button>
                    </el-form-item>
                    <el-form-item label="营运单位" label-width="75px" class="lf" style="margin-left: 20px;width: 58%;">
                        <el-cascader size="mini" :options="custOpt2" v-model="operateUnit1"></el-cascader>
                    </el-form-item>

                    <el-form-item label="备注" label-width="75px" class="lf" style="margin-left: 20px;">
                        <el-input v-model="remarks1" style='width: 200px !important;' size="mini"></el-input>
                    </el-form-item>
                    <div class="scheme-priority lf">
                        <div>结算方案优先级：</div>
                        <div>班次类型>车牌号>营运单位>班次号>线路</div>
                    </div>
                </el-form>
            </div>
            <!-- 左侧列表 E-->

            <!--右侧列表 S-->
            <div class="revise-right lf">
                <el-row>
                    <el-col :span="24" class="table-fun" style="height: 45px;">
                        <img src="../../assets/imgs/operation_icon_shuaxin_default.png" alt="" class="lf">
                        <div class="lf choose-title fun-text" @click="loadNew">刷新</div>
                        <img src="../../assets/imgs/operation_icon_tianjia_default.png" alt="" class="lf">
                        <div class="lf choose-title fun-text" @click="addRevise">添加</div>
                        <img src="../../assets/imgs/operation_icon_xiugai_default.png" alt="" class="lf">
                        <div class="lf choose-title fun-text" @click="reviseAdd">修改</div>
                        <img src="../../assets/imgs/operation_icon_shanchu_default.png" alt="" class="lf">
                        <div class="lf choose-title fun-text" @click="reviseDelete">删除</div>
                    </el-col>
                </el-row>
                <avue-crud @current-change="freeChange" @current-row-change="freeRChange1" :data="freeFruit"
                           :page="freePage" :option="freeForm"></avue-crud>
            </div>
            <!--右侧列表 E-->

            <div style="overflow: hidden;width: 100%;" class="rf">
                <button class="check-btn rf" @click="addCancelBtn1" style="width:90px;margin: 20px 10px 20px 0;">
                    <img src="../../assets/imgs/operation_btn_icon_quxiao_default.png" alt="" class="btn-img">
                    取消
                </button>
                <button class="check-btn rf" @click="addSureBtn1" style="width:90px;margin: 20px 10px 20px 0;">
                    <img src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">
                    确定
                </button>
            </div>
        </div>
        <!--修改弹窗 E-->

        <!--修改 的添加弹窗 S-->
        <div class="addModal-content" v-if="addModalContent">
            <div class="left-choose lf">
                <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt="" class="lf">
                <div class="lf title" style="color: #009688;padding-left: 10px;">{{this.xiuTitle}}</div>
            </div>
            <div class="addModal-box">
                <el-form ref="form">
                    <el-form-item label="费用名称*" label-width="75px" class="lf" style="margin-left: 20px;">
                        <el-input title="必须填写" v-model="costNames" style='width: 120px !important;'
                                  size="mini"></el-input>
                        <el-button @click="tiQu" icon="el-icon-search" size="mini">提取费用定义</el-button>
                    </el-form-item>
                    <!--    <el-form-item label="类别" label-width="50px" class="lf" style="margin-left: 20px;">
                            <el-input v-model="accounStyles" style='width: 150px !important;' size="mini"></el-input>
                        </el-form-item>-->
                    <el-form-item label="计费方式*" label-width="100px" class="lf">
                        <el-cascader title="必须填写" size="mini" :options="options"
                                     v-model="selectedOptions"></el-cascader>
                    </el-form-item>

                    <!--修改才有的 费用定义关联 S-->
                    <div class="guanlian lf" v-if="guanLian">
                        <div class="lf" style="margin: 0 15px 0 35px;line-height: 32px;">费用定义关联</div>
                        <div class="guanlian-txt lf">
                            <span>已关联费用定义【{{this.costNames}}】</span>
                            <span class="close-icon" @click="closeIcon">x</span>
                        </div>
                    </div>
                    <!--修改才有的 费用定义关联 E-->

                    <el-form-item label="费用公式*" label-width="100px" class="lf" style="margin-left: 45px;">
                        <div class="costFormula">
                            <el-input title="必须填写" v-model="costFormula" style='width: 380px !important;'
                                      size="mini"></el-input>
                            <button type="button" class="ver-btn" @click="verFormula" style="margin-left: 30px;">
                                <img src="../../assets/imgs/operation_btn_icon_yanzheng_default copy.png" alt=""
                                     class="btn-img">
                                验证公式
                            </button>
                            <div class="explanatory">
                                <span>注：<span>1. 公式中可直接输入数值；</span></span>
                                <p style="margin-top: -15px;">2.公式中也可以使用如下关键字结合运算式运算出结果：<span
                                        style="padding-left:10px;display:inline-block;color: #ED4014;">票价、票公里数、人数、票款、附加费合计、附加费每人、终点站票价；</span>
                                </p>
                                <p>3.除以上关键字外，公式中不允许出现中英文字或全角字符。</p>
                            </div>
                        </div>
                    </el-form-item>

                    <el-form-item label="保底方案" label-width="100px" class="lf" style="margin: 15px 0 0 45px;">
                        <div class="scheme">
                            <div class="scheme-title">注：按人次计费方式不适用</div>
                            <div class="radio">
                                <div class="radio-txt lf">触发条件</div>
                                <el-radio v-model="radio" label="1">满足其一</el-radio>
                                <el-radio v-model="radio" label="2">满足全部</el-radio>
                            </div>
                       <!--     <el-form-item label="备注" label-width="80px" style="margin-left: 5px;">
                                <el-input v-model="radioRemarks" style='width: 330px !important;'
                                          size="mini"></el-input>
                            </el-form-item>-->
                            <el-form-item label="保底公式" label-width="80px" style="margin-left: 5px;">
                                <el-input v-model="radioformulas" style='width: 330px !important;'
                                          size="mini"></el-input>
                                <button type="button" class="ver-btn" @click="radioFormula" style="margin-left: 30px;">
                                    <img src="../../assets/imgs/operation_btn_icon_yanzheng_default copy.png" alt=""
                                         class="btn-img">
                                    验证公式
                                </button>
                            </el-form-item>

                            <div class="schemeData">
                                <el-row>
                                    <el-col :span="24" class="table-fun" style="height: 30px;">
                                        <img src="../../assets/imgs/operation_icon_tianjia_default.png" alt=""
                                             class="lf">
                                        <div class="lf choose-title fun-text" @click="addIcon">添加</div>
                                        <img src="../../assets/imgs/operation_icon_shanchu_default.png" alt=""
                                             class="lf">
                                        <div class="lf choose-title fun-text" @click="deleteIcon">删除</div>
                                        <img src="../../assets/imgs/Radio_icon_yingyong_default.png" alt=""
                                             class="lf">
                                        <div class="lf choose-title fun-text" @click="applyIcon">应用</div>
                                    </el-col>
                                </el-row>
                                <el-table @current-change="handleCurrentChange" highlight-current-row :data="tableData"
                                          height="130" border style="width: 100%">
                                    <el-table-column prop="project1" label="项目" width="180"></el-table-column>
                                    <el-table-column prop="project2" label="比较方式" width="180"></el-table-column>
                                    <el-table-column prop="project3" label="值" width="180"></el-table-column>
                                </el-table>

                                <div class="schemeData-list" v-if="schemeData">
                                    <el-form-item label="" class="lf" style="flex: 1;">
                                        <el-cascader title="必须填写" size="mini" :options="peoOptions1"
                                                     v-model="peopleOptions" @change="peoChange">
                                        </el-cascader>
                                    </el-form-item>
                                    <el-form-item label="" class="lf" style="flex: 1;">
                                        <el-cascader title="必须填写" size="mini" :options="peoOptions2"
                                                     v-model="peopleOptions1" @change="peoChange1">
                                        </el-cascader>
                                    </el-form-item>
                                    <el-form-item label="" label-width="" class="lf">
                                        <el-input v-model="peopleOptions2" style='width: 120px !important;'
                                                  size="mini"></el-input>
                                    </el-form-item>
                                </div>
                            </div>
                        </div>
                    </el-form-item>

                    <!--验证通过 S-->
                    <div class="verPass" v-if="passTips"><span>验证通过</span></div>
                    <!--验证通过 E-->
                    <div class="btnbox rf">
                        <button type="button" class="cancel-btn rf" @click="cancelModalIco"><i
                                class="cancel-icon lf"></i><span class="lf">取消</span></button>
                        <button v-if="sureBtnIcos" type="button" class="sure-btn rf" @click="sureBtnIco"><i
                                class="lf"></i><span class="lf">确定</span></button>
                        <button v-if="sureBtnIcos1" type="button" class="sure-btn rf" @click="sureBtnIco1"><i
                                class="lf"></i><span class="lf">确定</span></button>
                    </div>
                </el-form>
            </div>
        </div>
        <!--修改 的添加弹窗 E-->

        <!--自定义日期 S-->
        <div class="choose choose1" v-if="choose1">
            <div class="left-choose lf" style="overflow: hidden;">
                <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt="" class="lf">
                <div class="lf title" style="color: #009688;padding-left: 10px;">请选择</div>
            </div>
            <el-col :span="24">
                <div class="choose-box">
                    <el-form ref="form" style="width:100%;overflow: hidden;">
                        <el-form-item label="" class="lf" style="margin: 0 90px 0 60px;">
                            <el-input v-model="mingcheng" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 90px 0 0;">
                            <el-input v-model="dateS" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 90px 0 0;">
                            <el-input v-model="dateE" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 90px 0 0;">
                            <el-input v-model="beizhu" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                    </el-form>
                </div>
                <avue-crud @current-change="chooseChange1" @current-row-change="chooseRChange1" :data="chooseFruit1"
                           :page="choosePage1" :option="chooseForm1"></avue-crud>

            </el-col>
            <button class="check-btn rf" @click="dell" type="button" style="width: 90px;">
                <img src="../../assets/imgs/operation_btn_icon_quxiao_default.png" alt="" class="btn-img">取消
            </button>
            <button class="check-btn rf" @click="dateBtn" style="width:90px;" v-if="datesBtn">
                <img src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">确定
            </button>
            <button class="check-btn rf" @click="dateBtn1" style="width:90px;" v-if="datesBtn1">
                <img src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">确定
            </button>
        </div>
        <!--自定义日期 E-->

        <!-- 结算单位 S-->
        <div class="choose choose1" v-if="choose2">
            <div class="left-choose lf" style="overflow: hidden;">
                <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt="" class="lf">
                <div class="lf title" style="color: #009688;padding-left: 10px;">请选择</div>
            </div>
            <el-col :span="24">
                <div class="choose-box">
                    <el-form ref="form" style="width:100%;overflow: hidden;">
                        <el-form-item label="" class="lf" style="margin: 0 90px 0 60px;">
                            <el-input v-model="bianma" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 90px 0 0;">
                            <el-input v-model="jiancheng" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 90px 0 0;">
                            <el-input v-model="kaihu" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 90px 0 0;">
                            <el-input v-model="zhanghao" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                    </el-form>
                </div>
                <avue-crud @current-change="chooseChange2" @current-row-change="chooseRChange2" :data="chooseFruit2"
                           :page="choosePage2" :option="chooseForm2"></avue-crud>

            </el-col>
            <button class="check-btn rf" @click="delll" type="button" style="width: 90px;">
                <img src="../../assets/imgs/operation_btn_icon_quxiao_default.png" alt="" class="btn-img">取消
            </button>
            <button class="check-btn rf" @click="jieSuansBtn" style="width:90px;" v-if="jieSuanBtn">
                <img src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">确定
            </button>
            <button class="check-btn rf" @click="jieSuansBtn1" style="width:90px;" v-if="jieSuanBtn1">
                <img src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">确定
            </button>
        </div>
        <!-- 结算单位 E-->

        <!--提取费用定义 S-->
        <div class="choose choose1" v-if="choose3">
            <div class="left-choose lf" style="overflow: hidden;">
                <img src="../../assets/imgs/operation_bg_biaoti_default.png" alt="" class="lf">
                <div class="lf title" style="color: #009688;padding-left: 10px;">请选择</div>
            </div>
            <el-col :span="24">
                <div class="choose-box">
                    <el-form ref="form" style="width:100%;overflow: hidden;">
                        <el-form-item label="" class="lf" style="margin: 0 45px 0 60px;">
                            <el-input v-model="leiBie" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 45px 0 0;">
                            <el-input v-model="feiYongM" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 45px 0 0;">
                            <el-input v-model="jiFei" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 45px 0 0;">
                            <el-input v-model="gongSi" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                        <el-form-item label="" class="lf" style="margin: 0 45px 0 0;">
                            <el-input v-model="feiYongBeiZhu" style='width: 110px !important;' size="mini"></el-input>
                        </el-form-item>
                    </el-form>
                </div>
                <avue-crud @current-change="chooseChange3" @current-row-change="chooseRChange3" :data="chooseFruit3"
                           :page="choosePage3" :option="chooseForm3"></avue-crud>

            </el-col>
            <button class="check-btn rf" @click="del3" type="button" style="width: 90px;">
                <img src="../../assets/imgs/operation_btn_icon_quxiao_default.png" alt="" class="btn-img">取消
            </button>
            <button class="check-btn rf" @click="tiQuBtn" style="width:90px;">
                <img src="../../assets/imgs/operation_btn_icon_tijiao_default.png" alt="" class="btn-img">确定
            </button>
        </div>
        <!--提取费用定义 E-->

        <!--删除弹窗 S-->
        <div class="deleteModal" v-if="showModal">
            <div class="deleteModal-box">
                <div class="delete-title"><i></i><span>你确定要删除吗？</span></div>
                <button class="sure-btn rf" @click="sureBtn">确定</button>
                <button class="cancel-btn rf" @click="canceBtn">取消</button>
            </div>
        </div>
        <!--删除弹窗 E-->

        <!--删除弹窗 S-->
        <div class="deleteModal" v-if="showModalNew">
            <div class="deleteModal-box">
                <div class="delete-title"><i></i><span>你确定要删除吗？</span></div>
                <button class="sure-btn rf" @click="sureBtnNew">确定</button>
                <button class="cancel-btn rf" @click="canceBtnNew">取消</button>
            </div>
        </div>
        <!--删除弹窗 E-->

    </div>
</template>

<script>
    export default {
        data: function () {
            return {
                jieSuanBtn:true,
                jieSuanBtn1:false,
                datesBtn:true,
                datesBtn1:false,
                delBtn1:true,
                delBtn2:false,
                sureBtnIcos: true,
                sureBtnIcos1: false,
                guanLian: false,
                revise: false,
                addModal: false,
                choose: false,
                choose1: false,
                choose2: false,
                showModal: false,
                showModalNew: false,
                addModalContent: false,
                choose3: false,
                xiuTitle: '',
                leiBie: '',
                feiYongM: '',
                jiFei: '',
                gongSi: '',
                feiYongBeiZhu: '',
                pOpt1: '',
                pOpt2: '',
                pOpt3: '',
                costNames: '',
                /* accounStyles: '',*/
                costFormula: '',
                radio: '1',
                selectedOptions: [],
                radioRemarks: '',
                radioformulas: '',
                tableData: [],
                schemeData: false,
                options: [
                    {
                        value: '每人次',
                        label: '每人次',
                    },
                    {
                        value: '每班次',
                        label: '每班次',
                    },
                    {
                        value: '每天按车辆收',
                        label: '每天按车辆收'
                    },
                    {
                        value: '每天按营运单位收',
                        label: '每天按营运单位收'
                    },
                    {
                        value: '每月按车辆收',
                        label: '每月按车辆收'
                    },
                    {
                        value: '每月按营运单位收',
                        label: '每月按营运单位收'
                    },
                    {
                        value: '每年按车辆收',
                        label: '每年按车辆收'
                    },
                    {
                        value: '每年按营运单位收',
                        label: '每年按营运单位收'
                    },
                ],
                peoOptions1: [
                    {
                        value: '总人数',
                        label: '总人数',
                    },
                    {
                        value: '总票款',
                        label: '总票款',
                    },
                ],
                peopleOptions: [],
                peopleOptions1: [],
                peoOptions2: [
                    {
                        value: '小于',
                        label: '小于',
                    },
                    {
                        value: '小于等于',
                        label: '小于等于',
                    },
                    {
                        value: '大于',
                        label: '大于',
                    },
                    {
                        value: '大于等于',
                        label: '大于等于',
                    },
                    {
                        value: '等于',
                        label: '等于',
                    },
                ],
                peopleOptions2: '0',
                passTips: false,
                remarks: '',
                remarks1: '',
                mingcheng: '',
                dateS: '',
                dateE: '',
                beizhu: '',
                bianma: '',
                jiancheng: '',
                kaihu: '',
                zhanghao: '',
                operateUnit: [],
                operateUnit1: [],
                closingUnit: '',
                closingUnit1: '',
                dateTo: '',
                dateTo1: '',
                addtype: '',
                addtype1: '',
                vehiNum: [],
                vehiNum1: [],
                classNum: '',
                classNum1: '',
                fangName: '',
                fangName1: '',
                fanganName: '',
                fenlei: '',
                classType: '',
                lineNameM: '',
                banciNum: '',
                yunying: '',
                cardNum: '',
                youxiaoqi: '',
                lineNames: [],
                lineNames1: [],
                costName: '',
                className: '',
                feiyongName: '',
                getId: '',
                getNewId: '',
                companyId: '',
                companyId1: '',
                lineId: '',
                custId: '',
                busId: '',
                delSureId: '',
                delSureId1: '',
                feeDefineId: '',
                planId: '',
                chooseId: '',
                chooseId1: '',
                baodiFormula:'',
                baodiRules:'',
                baodiType:'',
                formulaS:'',
                nameS:'',
                payType:'',
                remarkBd:'',
                jieSuanName:'',
                jieSuanName1:'',
                fangNameNew:'',
                qiYongNew:'',
                addSchemesNew :'',
                addtypeNew :'',
                dateSNew :'',
                dateENew :'',
                companyIdNew :'',
                busTypeNew :'',
                balanceTypeNew:'',
                lineNamesNew :'',
                operateUnitNew :'',
                vehiNumNew :'',
                remarksNew:'',
                lineIdNew:'',
                busIdNew:'',
                custIdNew:'',
                fangNameNew1:'',
                qiYongNew1:'',
                addSchemesNew1 :'',
                addtypeNew1 :'',
                dateSNew1 :'',
                dateENew1 :'',
                companyIdNew1 :'',
                busTypeNew1 :'',
                balanceTypeNew1:'',
                lineNamesNew1 :'',
                operateUnitNew1 :'',
                vehiNumNew1 :'',
                remarksNew1:'',
                lineIdNew1:'',
                busIdNew1:'',
                custIdNew1:'',
                endDateNew:'',
                startDateNew:'',
                endDateNew1:'',
                startDateNew1:'',
                chooseEndDate:'',
                chooseStartDate:'',
                nameShortNew:'',
                nameShortNew1:'',
                sexModel: [],
                sexOpt: [],
                lineName: [],
                cardName: [],
                custName: [],
                selectOpt: [],
                selectOpt1: [],
                selectOpt2: [],
                custOpt: [],
                custOpt1: [],
                custOpt2: [],
                custOpt3: [],
                cardOpt: [],
                cardOpt1: [],
                cardOpt2: [],
                dateOpt: [],
                fangAn: [],
                objs: [],
                freeFruit: [],
                costFruit: [],
                chooseFruit: [],
                chooseFruit1: [],
                chooseFruit2: [],
                chooseFruit3: [],
                dateName: [],
                fangClassify: [],
                addSchemes: [],
                addSchemes1: [],
                qiYong: [],
                qiYong1: [],
                busType: [],
                busType1: [],
                balanceType: [],
                balanceType1: [],
                qiyong: [
                    {
                        value: '1',
                        label: '是'
                    },
                    {
                        value: '0',
                        label: '否'
                    },
                ],
                qiyong1: [
                    {
                        value: '1',
                        label: '是'
                    },
                    {
                        value: '0',
                        label: '否'
                    },
                ],
                addScheme: [
                    {
                        value: '1',
                        label: '是'
                    },
                    {
                        value: '0',
                        label: '否'
                    },
                ],
                addScheme1: [
                    {
                        value: '1',
                        label: '是'
                    },
                    {
                        value: '0',
                        label: '否'
                    },
                ],
                bustype: [
                    {
                        value: '0',
                        label: '不限'
                    },
                    {
                        value: '1',
                        label: '正常班'
                    },
                    {
                        value: '2',
                        label: '加班'
                    },
                ],
                bustype1: [
                    {
                        value: '1',
                        label: '不限'
                    },
                    {
                        value: '0',
                        label: '正常班'
                    },
                    {
                        value: '-1',
                        label: '加班'
                    },
                ],
                balancetype: [
                    {
                        value: '月结',
                        label: '月结'
                    },
                    {
                        value: '即结',
                        label: '即结'
                    },
                ],
                balancetype1: [
                    {
                        value: '月结',
                        label: '月结'
                    },
                    {
                        value: '即结',
                        label: '即结'
                    },
                ],
                page: {
                    pageSizes: [10],//分页信息 pageSize
                    total: 20,//总页数 totalRow
                    currentPage: 1,//当前第几页 pageNumber

                    pageSize: 10,//每一页加载多少条数据
                },
                feePage: {
                    pageSizes: [10],//分页信息 pageSize
                    total: 20,//总页数 totalRow
                    currentPage: 1,//当前第几页 pageNumber

                    pageSize: 10,//每一页加载多少条数据
                },
                freePage: {
                    pageSizes: [10],//分页信息 pageSize
                    total: 20,//总页数 totalRow
                    currentPage: 1,//当前第几页 pageNumber

                    pageSize: 10,//每一页加载多少条数据
                },
                choosePage: {
                    pageSizes: [10],//分页信息 pageSize
                    total: 20,//总页数 totalRow
                    currentPage: 1,//当前第几页 pageNumber

                    pageSize: 10,//每一页加载多少条数据
                },
                choosePage1: {
                    pageSizes: [10],//分页信息 pageSize
                    total: 20,//总页数 totalRow
                    currentPage: 1,//当前第几页 pageNumber

                    pageSize: 10,//每一页加载多少条数据
                },
                choosePage2: {
                    pageSizes: [10],//分页信息 pageSize
                    total: 20,//总页数 totalRow
                    currentPage: 1,//当前第几页 pageNumber

                    pageSize: 10,//每一页加载多少条数据
                },
                choosePage3: {
                    pageSizes: [10],//分页信息 pageSize
                    total: 20,//总页数 totalRow
                    currentPage: 1,//当前第几页 pageNumber

                    pageSize: 10,//每一页加载多少条数据
                },
                dataForm: {
                    page: true,
                    align: 'center',
                    highlightCurrentRow: true,
                    addBtn: false,//是否添加按钮
                    delBtn: false,//是否添加删除按钮
                    editBtn: false,//是否添加编辑按钮
                    menu: false,//是否添加菜单按钮
                    index: true,
                    column: [
                        {
                            label: '结算方式',
                            prop: 'balance_type',
                        },
                        {
                            sortable: true,
                            label: '方案名称',
                            prop: 'name',
                        },
                        {
                            label: '附加',
                            prop: 'collection_id',
                        },
                        {
                            label: '分类',
                            prop: 'type'
                        },
                        {
                            label: '班次类型',
                            prop: 'bus_type',
                            formatter:function(row, value , label, column){
                                switch(row.bus_type){
                                    case -1:return "不限";break;
                                    case 1:return "正常";break;
                                    case 0:return "加班";break;
                                }
                            }

                        },
                        {
                            label: '线路',
                            prop: 'line_name'
                        },
                        {
                            label: '营运单位',
                            prop: 'cust_name'
                        },
                        {
                            label: '车牌号',
                            prop: 'vehi_no'
                        },
                        {
                            label: '班次号',
                            prop: 'bus_id'
                        },
                        {
                            sortable: true,
                            label: '有效期',
                            prop: 'start_date'
                        },
                        {
                            label: '结算单位',
                            prop: 'name_short'
                        },
                    ]
                },
                costForm: {
                    page: true,
                    align: 'center',
                    highlightCurrentRow: true,
                    addBtn: false,//是否添加按钮
                    delBtn: false,//是否添加删除按钮
                    editBtn: false,//是否添加编辑按钮
                    menu: false,//是否添加菜单按钮
                    index: true,
                    column: [
                        {
                            sortable: true,
                            label: '费用名称',
                            prop: 'name',
                        },
                        {
                            label: '计费方式',
                            prop: 'pay_type',
                        },
                        {
                            label: '关联定义',
                            prop: 'fee_define_name'
                        },
                        {
                            label: '公式',
                            prop: 'formula'
                        },
                    ]
                },
                chooseForm: {
                    page: true,
                    align: 'center',
                    highlightCurrentRow: true,
                    addBtn: false,//是否添加按钮
                    delBtn: false,//是否添加删除按钮
                    editBtn: false,//是否添加编辑按钮
                    menu: false,//是否添加菜单按钮
                    column: [
                        {
                            label: '方案名称',
                            prop: 'name',
                        },
                        {
                            label: '分类',
                            prop: 'type',
                        },
                        {
                            label: '班次类型',
                            prop: 'bus_type',
                        },
                        {
                            label: '线路',
                            prop: 'line_name',
                        },
                        {
                            label: '班次号',
                            prop: 'bus_id',
                        },
                        {
                            label: '营运单位',
                            prop: 'cust_name',
                        },
                        {
                            label: '车牌号',
                            prop: 'vehi_no',
                        },
                        {
                            label: '有效期',
                            prop: 'termvalidity',
                        },
                    ]
                },
                chooseForm1: {
                    page: true,
                    align: 'center',
                    highlightCurrentRow: true,
                    addBtn: false,//是否添加按钮
                    delBtn: false,//是否添加删除按钮
                    editBtn: false,//是否添加编辑按钮
                    menu: false,//是否添加菜单按钮
                    column: [
                        {
                            label: '名称',
                            prop: 'name',
                        },
                        {
                            label: '起始日期',
                            prop: 'start_date',
                        },
                        {
                            label: '结束日期',
                            prop: 'end_date',
                        },
                        {
                            label: '备注',
                            prop: 'remark',
                        },
                    ]
                },
                chooseForm2: {
                    page: true,
                    align: 'center',
                    highlightCurrentRow: true,
                    addBtn: false,//是否添加按钮
                    delBtn: false,//是否添加删除按钮
                    editBtn: false,//是否添加编辑按钮
                    menu: false,//是否添加菜单按钮
                    column: [
                        {
                            label: '编码',
                            prop: 'code',
                        },
                        {
                            label: '简称',
                            prop: 'name',
                        },
                        {
                            label: '开户银行',
                            prop: 'bankname',
                        },
                        {
                            label: '账号',
                            prop: 'bankno',
                        },
                    ]
                },
                chooseForm3: {
                    page: true,
                    align: 'center',
                    highlightCurrentRow: true,
                    addBtn: false,//是否添加按钮
                    delBtn: false,//是否添加删除按钮
                    editBtn: false,//是否添加编辑按钮
                    menu: false,//是否添加菜单按钮
                    column: [
                        {
                            label: '类别',
                            prop: 'type',
                        },
                        {
                            label: '费用名称',
                            prop: 'name',
                        },
                        {
                            label: '计费方式',
                            prop: 'pay_type',
                        },
                        {
                            label: '公式',
                            prop: 'formula',
                        },
                        {
                            label: '备注',
                            prop: 'remark',
                        },
                    ]
                },
                freeForm: {
                    page: true,
                    align: 'center',
                    highlightCurrentRow: true,
                    addBtn: false,//是否添加按钮
                    delBtn: false,//是否添加删除按钮
                    editBtn: false,//是否添加编辑按钮
                    menu: false,//是否添加菜单按钮
                    column: [
                        {
                            sortable: true,
                            label: '费用名称',
                            prop: 'name',
                        },
                        {
                            label: '计费方式',
                            prop: 'pay_type',
                        },
                        {
                            label: '公式',
                            prop: 'formula',
                        },
                        {
                            label: '关联定义',
                            prop: 'fee_define_name',
                        },
                    ]
                },
            };
        },
        methods: {
            getList() {//默认加载列表
                this.postRequest('/fin/balance/plan/list',
                    {
                        filterRules: JSON.stringify([
                            {"field":"fin_balance_plan.del_flag","op":"eq","value":"0"}
                        ]),
                        // order: 'desc,desc,asc',
                        page: this.page.currentPage,
                        rows: '10',
                        types: '',
                        feeName: ''
                    })
                    .then(target => {
                        console.log(target);
                        var tag = target.data.list;
                        //页码大小
                        this.page.pageSize = target.data.pageSize;
                        //页码数
                        this.page.pageNumber = target.data.pageNumber;
                        //总页数
                        this.page.total = target.data.totalRow;

                        this.objs = tag;
                        if (tag !== '') {
                            for (var i = 0; i < tag.length; i++) {
                                if (tag[i].is_additional) {
                                    this.objs[i].collection_id = '是';
                                } else {
                                    this.objs[i].collection_id = '否';
                                }
                            }
                        }
                    })
            },
            feesList() {//结算费用列表
                this.postRequest('/fin/balance/plan/fees/list',
                    {
                        filterRules: JSON.stringify([
                            {"field": "plan_id", "op": "eq", "value": this.getId}
                        ]),
                        order: 'asc',
                        rows: '10',
                        sort: 'name'
                    })
                    .then(target => {
                        console.log(target);
                        var tag = target.data.list;
                        //页码大小
                        this.feePage.pageSize = target.data.pageSize;
                        //页码数
                        this.feePage.pageNumber = target.data.pageNumber;
                        //总页数
                        this.feePage.total = target.data.totalRow;

                        this.costFruit = tag;
                    })
            },
            searchBusList() {//点击查询
                this.objs = [];

                this.postRequest('/fin/balance/plan/list', {
                    filterRules: JSON.stringify([
                        {"field": "fin_balance_plan.del_flag", "op": "eq", "value": "0"},
                        {"field": "fin_balance_plan.name", "op": "cn", "value": this.costName},
                        {"field": "fin_balance_plan.is_additional", "op": "eq", "value": this.sexModel[0]},
                        {"field": "fin_balance_plan.line_id", "op": "eq", "value": this.lineName[0]},
                        {"field": "fin_balance_plan.bus_id", "op": "cn", "value": this.className},
                        {"field": "fin_balance_plan.cust_id", "op": "eq", "value": this.custName[0]},
                        {"field": "fin_balance_plan.vehi_no", "op": "eq", "value": this.cardName[0]}
                        /*测试数据
                                          {"field":"fin_balance_plan.del_flag","op":"eq","value":"0"},
                                          {"field":"fin_balance_plan.name","op":"cn","value":"结算方案3"},
                                          {"field":"fin_balance_plan.is_additional","op":"eq","value":"0"},
                                          {"field":"fin_balance_plan.line_id","op":"eq","value":"157"},
                                          {"field":"fin_balance_plan.bus_id","op":"cn","value":"1500"},
                                          {"field":"fin_balance_plan.cust_id","op":"eq","value":"35"},
                                          {"field":"fin_balance_plan.vehi_no","op":"eq","value":"粤A12345"}
                        */
                    ]),
                    types: '',
                    feeName: this.feiyongName,
                    page: this.page.currentPage,
                    rows: 10,
                    sort: 'start_date,end_date,name',
                    order: 'desc,desc,asc'
                })
                    .then(target => {
                        console.log(target);
                        var tag = target.data.list;
                        //页码大小
                        this.page.pageSize = target.data.pageSize;
                        //页码数
                        this.page.pageNumber = target.data.pageNumber;
                        //总页数
                        this.page.total = target.data.totalRow;

                        this.objs = tag;

                        for (var i = 0; i < tag.length; i++) {
                            if (tag[i].is_additional) {
                                this.objs[i].collection_id = '是';
                            } else {
                                this.objs[i].collection_id = '否';
                            }
                        }

                    })
            },
            allList() {//点击刷新
                this.objs = [];
                this.getId="";
                this.postRequest('/fin/balance/plan/list',
                    {
                        filterRules: JSON.stringify([
                            {"field": "fin_balance_plan.del_flag", "op": "eq", "value": ""},
                            {"field": "fin_balance_plan.name", "op": "cn", "value": ""},
                            {"field": "fin_balance_plan.is_additional", "op": "eq", "value": ""},
                            {"field": "fin_balance_plan.line_id", "op": "eq", "value": ""},
                            {"field": "fin_balance_plan.bus_id", "op": "cn", "value": ""},
                            {"field": "fin_balance_plan.cust_id", "op": "eq", "value": ""},
                            {"field": "fin_balance_plan.vehi_no", "op": "eq", "value": ""}
                        ]),
                        types: '',
                        feeName: '',
                        page: this.page.currentPage,
                        rows: 10,
                        sort: 'start_date,end_date,name',
                        order: 'desc,desc,asc'
                    })
                    .then(target => {
                        console.log(target);
                        var tag = target.data.list;
                        //页码大小
                        this.page.pageSize = target.data.pageSize;
                        //页码数
                        this.page.pageNumber = target.data.pageNumber;
                        //总页数
                        this.page.total = target.data.totalRow;

                        this.objs = tag;
                        if(tag){
                            for (var i = 0; i < tag.length; i++) {
                                if (tag[i].is_additional) {
                                    this.objs[i].collection_id = '是';
                                } else {
                                    this.objs[i].collection_id = '否';
                                }
                            }
                        }

                    })
            },
            addClass() {//点击添加
                this.addModal = true;
            },
            showUpdateWin() {//点击修改
                if (this.getId === '') {
                    this.$message.error('请选择一条数据');
                }else if(this.planId === ''){
                    this.$message.error('请选择下面的结算费用的一条数据');
                }else {
                    this.revise = true;
                    this.postRequest('/fin/balance/plan/get', {
                        id: this.getId
                    })
                        .then(target => {
                            console.log(target);
                            var tag = target.data[1];

                            if (tag.is_enable) {
                                this.qiYong1 = ['1'];
                            } else {
                                this.qiYong1 = ['0'];
                            }
                            if (tag.is_additional) {
                                this.addSchemes1 = ['1'];
                            } else {
                                this.addSchemes1 = ['0'];
                            }
                            if (tag.bus_type == '0') {
                                this.busType1 = ['0'];
                            } else if (tag.bus_type == '1') {
                                this.busType1 = ['1'];
                            } else {
                                this.busType1 = ['-1'];
                            }
                            if (tag.balance_type === '即结') {
                                this.balanceType1 = ['即结'];
                            } else {
                                this.balanceType1 = ['月结'];
                            }


                            this.fangName1 = tag.name;
                            this.lineNames1 = ['['+tag.line_id+']'+tag.line_name];
                            this.classNum1 = tag.bus_id;
                            this.vehiNum1 = [tag.vehi_no];
                            this.addtype1 = tag.type;
                            this.dateTo1 = [tag.start_date, tag.end_date];
                            this.closingUnit1 = tag.balance_company_name_short;
                            this.custOpt2.push({
                                'value': '[' + tag.cust_id?tag.cust_id:'' + ']' + tag.cust_name?tag.cust_name:'',
                                'label': '[' + tag.cust_id?tag.cust_id:'' + ']' + tag.cust_name?tag.cust_name:'',
                            });
                            this.operateUnit1 = ['['+tag.cust_id+']'+tag.cust_name];
                            this.remarks1 = tag.remark;
                        });
                    this.feesListFruit();
                }
            },
            feesListFruit() {
                this.postRequest('/fin/balance/plan/fees/list', {
                    filterRules: JSON.stringify([
                        {"field": "plan_id", "op": "eq", "value": this.getId}
                    ]),
                    sort: 'name',
                    order: 'asc'
                })
                    .then(target => {
                        // console.log(target);
                        var tag = target.data.list;
                        //页码大小
                        this.freePage.pageSize = target.data.pageSize;
                        //页码数
                        this.freePage.pageNumber = target.data.pageNumber;
                        //总页数
                        this.freePage.total = target.data.totalRow;

                        this.freeFruit = tag;
                    });
            },
            loadNew() {
                this.freeFruit = [];
                this.postRequest('/fin/balance/plan/fees/list', {
                    id: this.getId
                })
                    .then(target => {
                        console.log(target);
                        var tag = target.data.list;
                        //页码大小
                        this.freePage.pageSize = target.data.pageSize;
                        //页码数
                        this.freePage.pageNumber = target.data.pageNumber;
                        //总页数
                        this.freePage.total = target.data.totalRow;

                        this.freeFruit = tag;
                    });
            },
            addRevise() {
                this.xiuTitle = '添加';
                this.guanLian = false;
                this.sureBtnIcos = true;
                this.sureBtnIcos1 = false;
                this.addModalContent = true;
            },
            verFormula() {//点击验证公式;
                if (this.costFormula === '') {
                    this.$message.error("请输入公式");
                } else {
                    this.isFormulaVaild();
                }
            },
            radioFormula() {//点击验证公式;
                if (this.radioformulas === '') {
                    this.$message.error("请输入公式");
                } else {
                    this.isFormulaVaild();
                }
            },
            addIcon() {//弹窗-----添加
                if (this.pOpt1 !== '' && this.pOpt2 !== '') {
                    console.log(1);
                    this.newIndex++;
                    this.schemeData = false;
                    this.tableData.push({
                        project1: this.peopleOptions,
                        project2: this.peopleOptions1,
                        project3: this.peopleOptions2,
                        index: this.newIndex
                    });
                    this.pOpt1 = '';
                    this.pOpt2 = '';
                    this.pOpt3 = '';
                } else if (this.pOpt1 === '' && this.pOpt2 === '') {
                    this.schemeData = true;
                    this.peopleOptions = [];
                    this.peopleOptions1 = [];
                    this.peopleOptions2 = '0';
                }
            },
            deleteIcon() {//弹窗-----删除
                this.schemeData = false;

                var tag = this.tableData;
                for (var i = 0; i < tag.length; i++) {
                    // console.log(this.currentRows);
                    console.log(tag[i].index);
                    if (this.currentRows === tag[i].index) {
                        this.tableData.splice(i, 1);//因为下标删除了，所以会报错
                    }
                }
            },
            applyIcon() {//弹窗-----应用

            },
            handleCurrentChange(val) {
                this.currentRows = val.index;
                console.log(val);
            },
            peoChange(value) {
                console.log(value);
                if (value !== '') {
                    this.pOpt1 = value[0];
                }
            },
            peoChange1(value) {
                console.log(value);
                if (value !== '') {
                    this.pOpt2 = value[0];
                }
            },
            cancelModalIco() {//弹窗取消按钮
                this.addModalContent = false;
                this.costNames = '';
                /*  this.accounStyles = '';*/
                this.costFormula = '';
                this.radio = '1';
                this.radioformulas = '';
                // this.radioRemarks = '';
                this.peopleOptions = [];
                this.peopleOptions1 = [];
                this.peopleOptions2 = [];
            },
            sureBtnIco() {//弹窗确定按钮 添加

                if (this.costNames === '') {
                    this.$message.error("请填写费用名称");
                } else if (this.selectedOptions == '') {
                    this.$message.error("请填写计费方式");
                } else if (this.costFormula === '') {
                    this.$message.error("请填写费用公式");
                }else if(this.feeDefineId === ''){
                    this.$message.error("请点击提取费用定义按钮");
                }else if(this.peopleOptions[0] == ''){
                    this.$message.error("请点击添加按钮增加数据");
                } else {
                    // console.log('balanceFee.baodi_rules=[{factor:' + this.peopleOptions[0] + '', 'operator:' + this.peopleOptions1[0] + '', 'val:' + this.peopleOptions2 + '}]');
                    this.postRequest('/fin/balance/plan/fees/add',
                        {
                            'balancePlanFees.baodi_rules': JSON.stringify([
                                {
                                    'factor': this.peopleOptions[0],
                                    'operator': this.peopleOptions1[0],
                                    'val': this.peopleOptions2
                                }
                            ]),
                            'balancePlanFees.id' : this.getId,
                            'balancePlanFees.plan_id' : this.planId,
                            'balancePlanFees.fee_define_id' : this.feeDefineId,
                            'balancePlanFees.name': this.costNames,
                            /*'balanceFee.type' : this.accounStyles,*/
                            'balancePlanFees.pay_type': this.selectedOptions[1],
                            'balancePlanFees.formula': this.costFormula,
                            'balancePlanFees.baodi_type': this.radio,
                            'balancePlanFees.baodi_formula': this.radioformulas,
                            // 'balancePlanFees.remark': this.radioRemarks,
                        })
                        .then(target => {
                            console.log(target);
                            if (target.data[0] === '0') {
                                this.$message.success(target.data[1]);
                                this.addModalContent = false;
                                this.feesListFruit();
                            } else if (target.data[0] === '-1') {
                                this.$message.error(target.data[1]);
                                this.addModalContent = false;
                            }
                        });
                }
            },
            sureBtnIco1() {//修改弹窗的    点击确定  修改
                if (this.costNames === '') {
                    this.$message.error("请填写费用名称");
                } else if (this.selectedOptions == '') {
                    this.$message.error("请填写计费方式");
                } else if (this.costFormula === '') {
                    this.$message.error("请填写费用公式");
                }else if(this.feeDefineId === ''){
                    this.$message.error("请点击提取费用定义按钮");
                } else {
                    this.postRequest('/fin/balance/plan/fees/update',
                        {
                            'balanceFee.baodi_rules': JSON.stringify([
                                { 'factor':this.peopleOptions[0]?this.peopleOptions[0]:'','operator':this.peopleOptions1[0]?this.peopleOptions1[0]:'','val':this.peopleOptions2 ? this.peopleOptions2 : ''}
                            ]),
                            'balancePlanFees.id' : this.getId,
                            'balancePlanFees.plan_id' : this.planId,
                            'balancePlanFees.fee_define_id' : this.feeDefineId,
                            'balancePlanFees.name' : this.costNames,
                            'balancePlanFees.pay_type' : this.selectedOptions[1],
                            'balancePlanFees.formula' : this.costFormula,
                            'balancePlanFees.baodi_type' : this.radio,
                            'balancePlanFees.baodi_formula' : this.radioformulas,
                            // 'balancePlanFees.remark' : this.radioRemarks ? this.radioRemarks : '',
                        })
                        .then(target=>{
                            console.log(target);
                            if(target.data[0] === '0'){
                                this.$message.success(target.data[1]);
                                this.addModalContent = false;
                                this.feesListFruit();
                            }else if(target.data[0] === '-1'){
                                this.$message.error(target.data[1]);
                                this.addModalContent = false;
                            }
                        });
                }
            },
            isFormulaVaild() {
                // this.postRequest('/fin/balance/plan/fees/isFormulaVaild?f=%E7%A5%A8%E4%BB%B7*0.01*%E4%BA%BA%E6%95%B0')
                this.postRequest('/fin/balance/plan/fees/isFormulaVaild?f=' + this.radioformulas + '')
                    .then(target => {
                        console.log(target);
                        if (target.data[0] === '0') {
                            this.passTips = true;
                            //定时执行，2秒后执行
                            window.setTimeout(this.refreshCount, 2000);
                            this.$message.success('验证成功');
                            // this.$message.success(target.data[1]);
                        }
                    });
            },
            deleteClass() {//点击删除
                if (this.getId == '') {
                    this.$message.error('请选择一条要删除的数据');
                } else {
                    this.showModal = true;
                }
            },
            reviseDelete() {
                if (this.getNewId === '') {
                    this.$message.error('请选择要删除的一条数据')
                } else {
                    this.showModalNew = true;
                }
            },
            sureBtn() {//点击删除的确定按钮
                this.postRequest('/fin/balance/plan/del', {id: this.getId})
                    .then(target => {
                        console.log(target);
                        if (target.data[0] === '0') {
                            this.$message.success(target.data[1]);
                            this.showModal = false;
                        }
                        this.getList();
                    })
                    this.getId="";
            },
            sureBtnNew() {
                this.postRequest('/fin/balance/plan/fees/del', {id: this.getNewId})
                    .then(target => {
                        console.log(target);
                        if (target.data[0] === '0') {
                            this.$message.success(target.data[1]);
                            this.showModalNew = false;
                        }
                        this.showUpdateWin();
                    })
            },
            canceBtn() {
                this.showModal = false;
            },
            canceBtnNew() {
                this.showModalNew = false;
            },
            rowChange(val) {//点击页码
                console.log(val);
                this.page.currentPage = val;
                this.allList();
            },
            chooseChange(val) {
                console.log(val);
                this.choosePage.currentPage = val;
                this.getSearch();
            },
            chooseChange1(val) {
                console.log(val);
                this.choosePage1.currentPage = val;
                this.dateCode();
            },
            chooseChange2(val) {
                console.log(val);
                this.choosePage2.currentPage = val;
                this.yingCode();
            },
            chooseChange3(val) {
                this.choosePage3.currentPage = val;
                this.getSearch1();
            },
            freeChange(val) {
                console.log(val);
                this.freePage.currentPage = val;
                this.feesListFruit();
            },
            freeRChange1(val) {
                console.log(val);
                this.getNewId = val.id;
            },
            curRChange(val) {//点击行读取对应的信息
                console.log(val);
                // this.companyId = val.balance_company_id;
                this.lineId = val.line_id;
                // this.custId = val.cust_id;
                this.busId = val.bus_id;
                this.getId = val.id;
                console.log(this.getId);
                this.feesList();
            },
            jiesuanRChange(val) {//点击行读取对应的信息
                console.log(val);
                this.planId = val.id;
            },
            reviseAdd() {
                if (this.getNewId !== '') {
                    this.xiuTitle = '修改';
                    this.sureBtnIcos = false;
                    this.sureBtnIcos1 = true;
                    this.addModalContent = true;
                    this.guanLian = true;
                    this.postRequest('/fin/balance/plan/fees/get', {id: this.getNewId})
                        .then(target => {
                            console.log(target);
                            if (target.data[0] == '0') {
                                var tag = target.data[1];
                                /*每天/年/月按车辆收 每天/月/年/按营运单位收*/
                                if (tag.pay_type == '每人次') {
                                    this.selectedOptions = ['每人次'];
                                } else if (tag.pay_type == '每班次') {
                                    this.selectedOptions = ['每班次'];
                                } else if (tag.pay_type == '每天按车辆收') {
                                    this.selectedOptions = ['每天按车辆收'];
                                } else if (tag.pay_type == '每月按车辆收') {
                                    this.selectedOptions = ['每月按车辆收'];
                                } else if (tag.pay_type == '每年按车辆收') {
                                    this.selectedOptions = ['每年按车辆收'];
                                } else if (tag.pay_type == '每年按营运单位收') {
                                    this.selectedOptions = ['每年按营运单位收'];
                                } else if (tag.pay_type == '每月按营运单位收') {
                                    this.selectedOptions = ['每月按营运单位收'];
                                } else {
                                    this.selectedOptions = ['每天按营运单位收'];
                                }

                                this.costNames = tag.name;
                                /*this.accounStyles = tag.type;*/
                                this.costFormula = tag.formula;
                                this.radio = tag.baodi_type;
                                this.radioformulas = tag.baodi_formula;
                                // this.radioRemarks = tag.remark;
                                if (tag.baodi_rules.length == 1) {
                                    var tag1 = tag.baodi_rules.indexOf('[');

                                    var tag2 = tag.baodi_rules.indexOf(']');

                                    var valId = tag.baodi_rules.substring(tag1 + 1, tag2);

                                    var objS = eval("(" + valId + ")");

                                    this.tableData.push({
                                        project1: objS.factor,
                                        project2: objS.operator,
                                        project3: objS.val
                                    });
                                }

                            } else {
                                this.$message.error(target.data[1])
                            }
                        });
                } else {
                    this.$message.error('请选择一条数据');
                }
            },
            closeIcon() {
                alert('后台没提供解除费用定义的关联的接口');
            },
            tiQu() {
                this.choose3 = true;
                this.getSearch1();
            },
            chooseRChange(val) {//点击行读取对应的信息
                console.log(val);
                this.delSureId = val.id;
                this.delSureId1 = val.id;

                this.fangNameNew = val.name;
                this.qiYongNew = val.is_enable;
                this.addSchemesNew = val.is_additional;
                this.addtypeNew = val.type;
                this.dateSNew = val.start_date;
                this.dateENew = val.end_date;
                this.companyIdNew = val.balance_company_id;
                this.busTypeNew = val.bus_type;
                this.balanceTypeNew = val.balance_type;
                this.lineNamesNew = val.line_name;
                this.lineIdNew = val.line_id;
                this.busIdNew = val.bus_id;
                this.custIdNew = val.cust_id;
                this.operateUnitNew = val.cust_name;
                this.vehiNumNew = val.vehi_no;
                this.remarksNew = val.remark;
                this.nameShortNew = val.name_short;
                this.startDateNew = val.start_date;
                this.endDateNew = val.end_date;

                this.fangNameNew1 = val.name;
                this.qiYongNew1 = val.is_enable;
                this.addSchemesNew1 = val.is_additional;
                this.addtypeNew1 = val.type;
                this.dateSNew1 = val.start_date;
                this.dateENew1 = val.end_date;
                this.companyIdNew1 = val.balance_company_id;
                this.busTypeNew1 = val.bus_type;
                this.balanceTypeNew1 = val.balance_type;
                this.lineNamesNew1 = val.line_name;
                this.lineIdNew1 = val.line_id;
                this.busIdNew1 = val.bus_id;
                this.custIdNew1 = val.cust_id;
                this.operateUnitNew1 = val.cust_name;
                this.vehiNumNew1 = val.vehi_no;
                this.remarksNew1 = val.remark;
                this.nameShortNew1 = val.name_short;
                this.startDateNew1 = val.start_date;
                this.endDateNew1 = val.end_date;
            },
            chooseRChange1(val) {//点击行读取对应的信息
                console.log(val);
                this.chooseId = val.id;
                this.chooseId1 = val.id;

                this.startDateNew = val.start_date;
                this.endDateNew = val.end_date;

                this.startDateNew1 = val.start_date;
                this.endDateNew1 = val.end_date;
            },
            chooseRChange2(val) {//点击行读取对应的信息
                console.log(val);
                this.jieSuanName = val.name;
                this.jieSuanName1 = val.name;

                this.companyId = val.id;
                this.companyId1 = val.id;
            },
            chooseRChange3(val) {//点击行读取对应的信息
                console.log(val);
                this.feeDefineId = val.id;
                this.baodiFormula = val.baodi_formula;
                this.baodiRules = val.baodi_rules;
                this.baodiType = val.baodi_type;
                this.formulaS = val.formula;
                this.nameS = val.name;
                this.payType = val.pay_type;
                // this.remarkBd = val.remark;
            },
            getYesOrNo() {
                this.postRequest('/common/constant/getYesOrNo')
                    .then(target => {
                        console.log(target);
                        var tag = target.data;
                        for (var i = 0; i < tag.length; i++) {
                            this.sexOpt.push({
                                'value': tag[i].value,
                                'label': tag[i].key,
                            });
                        }
                    })
            },
            line() {
                this.postRequest('/sch/data/line/listWithSpell')
                    .then(target => {
                        console.log(target);
                        var tag = target.data;
                        for (var i = 0; i < tag.length; i++) {
                            this.selectOpt.push({
                                'value': tag[i].id,
                                'label': '[' + tag[i].id + ']' + tag[i].name,
                            });
                            this.selectOpt1.push({
                                'value': tag[i].name,
                                'label': '[' + tag[i].id + ']' + tag[i].name,
                            });
                            this.selectOpt2.push({
                                'value': tag[i].name,
                                'label': '[' + tag[i].id + ']' + tag[i].name,
                            });
                        }
                    })
            },
            bus_company() {
                this.postRequest('/sch/data/bus_company/listWithSpell')
                    .then(target => {
                        console.log(target);
                        var tag = target.data;
                        for (var i = 0; i < tag.length; i++) {
                            this.custOpt.push({
                                'value': tag[i].id,
                                'label': '[' + tag[i].id + ']' + tag[i].name,
                            });
                            this.custOpt1.push({
                                'value': '[' + tag[i].id + ']' + tag[i].name,
                                'label': '[' + tag[i].id + ']' + tag[i].name,
                            });
                            this.custOpt2.push({
                                'value': '[' + tag[i].id + ']' + tag[i].name,
                                'label': '[' + tag[i].id + ']' + tag[i].name,
                            });
                        }
                    })
            },
            bus_vehicle() {
                this.postRequest('/sch/data/bus_vehicle/listWithSpell')
                    .then(target => {
                        console.log(target);
                        var tag = target.data;
                        for (var i = 0; i < tag.length; i++) {
                            this.cardOpt.push({
                                'value': tag[i].vehi_no,
                                'label': tag[i].vehi_no,
                            });
                            this.cardOpt1.push({
                                'value': tag[i].vehi_no,
                                'label': tag[i].vehi_no,
                            });
                            this.cardOpt2.push({
                                'value': tag[i].vehi_no,
                                'label': tag[i].vehi_no,
                            });
                        }
                    })
            },
            getDateScopes() {
                this.postRequest('/fin/balance/plan/getDateScopes')
                    .then(target => {
                        console.log(target);
                        var tag = target.data;
                        for (var i = 0; i < tag.length; i++) {
                            this.dateOpt.push({
                                'value': tag[i].end_date + '=>' + tag[i].start_date,
                                'label': tag[i].end_date + '=>' + tag[i].start_date,
                            });
                        }
                    })
            },
            types() {
                this.postRequest('/fin/balance/plan/types')
                    .then(target => {
                        console.log(target);
                        var tag = target.data;
                        for (var i = 0; i < tag.length; i++) {
                            this.fangAn.push({
                                'value': tag[i].type_name,
                                'label': tag[i].type_name,
                            });
                        }
                    })
            },
            searchCode() {
                this.choose = true;
                this.getSearch();
                this.delBtn2 = false;
                this.delBtn1 = true;

                this.datesBtn1 = false;
                this.datesBtn = true;
            },
            searchCode1() {
                this.choose = true;
                this.delBtn2 = true;
                this.delBtn1 = false;
                this.getSearch();
            },
            del() {
                this.choose = false;
                this.fanganName = '';
                this.fenlei = '';
                this.classType = '';
                this.lineNameM = '';
                this.banciNum = '';
                this.yunying = '';
                this.cardNum = '';
                this.youxiaoqi = '';
                this.choosePage.currentPage = 1;
            },
            delSureBtn() {//添加的提取已有方案里的 确定

                if (this.delSureId == '') {
                    this.$message.error("请选择一条数据");
                } else {
                    this.choosePage.currentPage = 1;
                    this.fangName = this.fangNameNew ;

                    if (this.qiYongNew) {
                        this.qiYong = ['1'];
                    } else {
                        this.qiYong = ['0'];
                    }
                    if (this.addSchemesNew) {
                        this.addSchemes = ['1'];
                    } else {
                        this.addSchemes = ['0'];
                    }
                    if (this.busTypeNew == '0') {
                        this.busType = ['0'];
                    } else if (this.busTypeNew == '1') {
                        this.busType = ['1'];
                    } else {
                        this.busType = ['-1'];
                    }
                    if (this.balanceTypeNew === '即结') {
                        this.balanceType = ['即结'];
                    } else {
                        this.balanceType = ['月结'];
                    }

                    this.classNum = this.busIdNew;
                    this.addtype = this.addtypeNew ;
                    this.companyId = this.companyIdNew ;
                    this.lineNames = ['['+this.lineIdNew+']'+this.lineNamesNew];
                    this.operateUnit = ['['+this.custIdNew+']'+this.operateUnitNew] ;
                    this.vehiNum = [this.vehiNumNew] ;
                    this.remarks = this.remarksNew ;
                    this.closingUnit = this.nameShortNew;
                    this.dateTo = [this.startDateNew,this.endDateNew];
                    this.choose = false;
                }
            },
            delSureBtn1() {//修改的提取已有方案里的 确定
                if (this.delSureId1 == '') {
                    this.$message.error("请选择一条数据");
                } else {
                    this.choosePage.currentPage = 1;

                    if (this.qiYongNew1) {
                        this.qiYong1 = ['1'];
                    } else {
                        this.qiYong1 = ['0'];
                    }
                    if (this.addSchemesNew1) {
                        this.addSchemes1 = ['1'];
                    } else {
                        this.addSchemes1 = ['0'];
                    }
                    if (this.busTypeNew1 == '0') {
                        this.busType1 = ['0'];
                    } else if (this.busTypeNew1 == '1') {
                        this.busType1 = ['1'];
                    } else {
                        this.busType1 = ['-1'];
                    }
                    if (this.balanceTypeNew1 === '即结') {
                        this.balanceType1 = ['即结'];
                    } else {
                        this.balanceType1 = ['月结'];
                    }

                    this.fangName1 = this.fangNameNew1 ;
                    this.classNum1 = this.busIdNew1;
                    this.lineNames1 = ['['+this.lineIdNew1+']'+this.lineNamesNew1];
                    // this.vehiNum1 = [this.vehiNumNew1];
                    this.cardOpt2.push({
                        'value': this.vehiNumNew1,
                        'label': this.vehiNumNew1,
                    });
                    this.vehiNum1 = [this.vehiNumNew1];
                    this.addtype1 = this.addtypeNew1;
                    this.dateTo1 = [this.startDateNew1,this.endDateNew1];
                    this.closingUnit1 = this.nameShortNew1;
                    this.operateUnit1 = ['['+this.custIdNew1+']'+this.operateUnitNew1] ;
                    this.remarks1 = this.remarksNew1 ;
                    this.choose = false;
                }
            },
            dell() {
                this.choose1 = false;
                this.mingcheng = '';
                this.dateS = '';
                this.dateE = '';
                this.beizhu = '';
            },
            delll() {
                this.choose2 = false;
                this.bianma = '';
                this.jiancheng = '';
                this.kaihu = '';
                this.zhanghao = '';
            },
            del3() {
                this.choose3 = false;
                this.leiBie = '';
                this.feiYongM = '';
                this.jiFei = '';
                this.gongSi = '';
                this.feiYongBeiZhu = '';
            },
            tiQuBtn(){
                if(this.feeDefineId === ''){
                    this.$message.error("请选择一条数据");
                }else{
                    console.log(this.feeDefineId);
                    this.choose3 = false;
                    this.leiBie = '';
                    this.feiYongM = '';
                    this.jiFei = '';
                    this.gongSi = '';
                    this.feiYongBeiZhu = '';

                   /* this.baodiFormula = this.costFormula;
                    this.baodiRules = val.baodi_rules;
                    this.baodiType = this.radio;
                    this.formulaS = val.formula;
                    this.nameS = this.costNames;
                    this.payType = val.pay_type;
                    this.remarkBd = this.radioRemarks;*/
                    this.costNames = this.nameS;
                    this.selectedOptions = [this.payType];
                    this.costFormula = this.formulaS;
                    this.radio = this.baodiType;
                    // this.radioRemarks = this.remarkBd;
                    this.radioformulas = this.baodiFormula;

                    var val1 = this.baodiRules.indexOf('[');

                    var val2 = this.baodiRules.indexOf(']');

                    var valueId = this.baodiRules.substring(val1 + 1, val2);

                    var objVal = eval("(" + valueId + ")");
                    this.tableData = [];
                    this.tableData.push({
                        project1: objVal.factor,
                        project2: objVal.operator,
                        project3: objVal.val
                    });
                }
            },
            jieSuansBtn(){
                if(this.companyId === ''){
                    this.$message.error("请选择一条数据");
                }else{
                    this.closingUnit = this.jieSuanName;
                    this.choose2 = false;
                }
            },
            jieSuansBtn1(){
                if(this.companyId1 === ''){
                    this.$message.error("请选择一条数据");
                }else{
                    this.closingUnit1 = this.jieSuanName1;
                    this.choose2 = false;
                }
            },
            getSearch() {
                this.postRequest('/fin/balance/plan/list', {
                    filterRules: JSON.stringify([
                        {"field": "fin_balance_plan.name", "op": "cn", "value": " "},
                        {"field": "type", "op": "cn", "value": " "},
                        {"field": "bus_type", "op": "cn", "value": " "},
                        {"field": "line_name", "op": "cn", "value": " "},
                        {"field": "bus_id", "op": "cn", "value": " "},
                        {"field": "cust_name", "op": "cn", "value": " "},
                        {"field": "vehi_no", "op": "cn", "value": " "},
                        {"field": "start_date", "op": "cn", "value": " "}
                    ]),
                    page: this.choosePage.currentPage,
                    rows: '10',
                })
                    .then(target => {
                        console.log(target);
                        var tag = target.data.list;
                        //页码大小
                        this.choosePage.pageSize = target.data.pageSize;
                        //页码数
                        this.choosePage.pageNumber = target.data.pageNumber;
                        //总页数
                        this.choosePage.total = target.data.totalRow;

                        this.chooseFruit = tag;
                    });
            },
            getSearch1() {
                this.postRequest('/fin/balance/fee/fees', {
                    filterRules: JSON.stringify([
                        {"field": "type", "op": "cn", "value": " "},
                        {"field": "name", "op": "cn", "value": " "},
                        {"field": "pay_type", "op": "cn", "value": " "},
                        {"field": "formula", "op": "cn", "value": " "},
                        {"field": "remark", "op": "cn", "value": " "}
                    ]),
                    page: this.choosePage3.currentPage,
                    rows: '10',
                })
                    .then(target => {
                        console.log(target);
                        var tag = target.data.list;
                        //页码大小
                        this.choosePage3.pageSize = target.data.pageSize;
                        //页码数
                        this.choosePage3.pageNumber = target.data.pageNumber;
                        //总页数
                        this.choosePage3.total = target.data.totalRow;

                        this.chooseFruit3 = tag;
                    });
            },
            addCancelBtn() {
                this.addModal = false;

            },
            addCancelBtn1() {
                this.revise = false;
            },
            getDatesList(){
                this.postRequest('/sys/customdatescope/list', {
                    filterRules: JSON.stringify([
                        {"field": "name", "op": "cn", "value": " "},
                        {"field": "start_date", "op": "cn", "value": " "},
                        {"field": "end_date", "op": "cn", "value": " "},
                        {"field": "remark", "op": "cn", "value": " "},
                    ]),
                    page: this.choosePage1.currentPage,
                    rows: '10',
                    sort: 'name,start_date',
                    order: 'desc,asc'
                }).then(target => {
                    console.log(target);
                    var tag = target.data.list;
                    //页码大小
                    this.choosePage1.pageSize = target.data.pageSize;
                    //页码数
                    this.choosePage1.pageNumber = target.data.pageNumber;
                    //总页数
                    this.choosePage1.total = target.data.totalRow;

                    this.chooseFruit1 = tag;
                });
            },
            dateCode() {
                this.getDatesList();
                this.choose1 = true;
                this.datesBtn = true;
                this.datesBtn1 = false;

            },
            dateBtn(){
                if(this.chooseId == ''){
                    this.$message.error("请选择一条数据");
                }else{
                    this.dateTo = [this.startDateNew,this.endDateNew];
                    this.choose1 = false;
                }
            },
            dateBtn1(){
                if(this.chooseId1 == ''){
                    this.$message.error("请选择一条数据");
                }else{
                    this.dateTo1 = [this.startDateNew1,this.endDateNew1];
                    this.choose1 = false;
                }
            },
            dateCode1() {
                this.getDatesList();
                this.choose1 = true;
                this.datesBtn = false;
                this.datesBtn1 = true;
            },
            getYingYun(){
                this.postRequest('/fin/balance/company/list', {
                    filterRules: JSON.stringify([
                        {"field": "code", "op": "cn", "value": " "},
                        {"field": "name_short", "op": "cn", "value": "  "},
                        {"field": "bankname", "op": "cn", "value": " "},
                        {"field": "bankno", "op": "cn", "value": " "}
                    ]),
                    page: this.choosePage2.currentPage,
                    rows: '10',
                }).then(target => {
                    console.log(target);
                    var tag = target.data.list;
                    //页码大小
                    this.choosePage2.pageSize = target.data.pageSize;
                    //页码数
                    this.choosePage2.pageNumber = target.data.pageNumber;
                    //总页数
                    this.choosePage2.total = target.data.totalRow;

                    this.chooseFruit2 = tag;
                });
            },
            yingCode() {
                this.choose2 = true;
                this.getYingYun();
                this.jieSuanBtn = true;
                this.jieSuanBtn1 = false;
            },
            yingCode1() {
                this.choose2 = true;
                this.getYingYun();
                this.jieSuanBtn = false;
                this.jieSuanBtn1 = true;
            },
            addSureBtn() {//点击添加的  确定按钮
                // console.log(result);
                /*console.log(this.fangName);
                console.log(this.lineNames );
                console.log(this.qiYong );
                console.log(this.addSchemes );
                console.log(this.classNum );
                console.log(this.vehiNum );
                console.log(this.busType );
                console.log(this.balanceType );
                console.log(this.addtype );
                console.log(this.dateToString(this.dateTo[0]));
                console.log(this.dateToString(this.dateTo[1]));
                console.log(this.closingUnit );
                console.log(this.operateUnit );
                console.log(this.remarks );*/
                if(this.operateUnit.length){
                    var indxOper = this.operateUnit[0].indexOf(']');
                    var resultS = this.operateUnit[0].slice(indxOper+1);
                }
                // console.log(this.startDateNew);
                // console.log(this.endDateNew);
                if (this.fangName == '' || this.qiYong == '' || this.addSchemes == '' || this.busType == '' || this.balanceType == '') {
                    this.$message.error('带*号的是必须填写噢!');
                } else if (this.vehiNum === '') {
                    this.$message.error('请输入车牌号!');
                } else if (this.lineNames === '') {
                    this.$message.error('请输入线路名!');
                }else if(this.dateTo == []){
                    this.$message.error('请选择有效期起始时间!');
                }else {

                     this.postRequest('/fin/balance/plan/add', {
                         'balancePlan.id': this.planId,
                         'copy_from': this.delSureId ? this.delSureId : '',
                         'balancePlan.name': this.fangName,
                         'balancePlan.is_enable': this.qiYong,
                         'balancePlan.is_additional': this.addSchemes,
                         'balancePlan.type': this.addtype,
                         'balancePlan.start_date': this.startDateNew,
                         'balancePlan.end_date': this.endDateNew,
                         'balancePlan.balance_company_id': this.companyId,
                         'balancePlan.bus_type': this.busType,
                         'balancePlan.balance_type': this.balanceType,
                         'balancePlan.line_id': this.indexOfFun(this.lineNames[0]) ? this.indexOfFun(this.lineNames[0]) : '',
                         'balancePlan.line_name': this.lineNames,
                         'balancePlan.bus_id': this.classNum ? this.classNum : '',
                         'balancePlan.cust_id': this.indexOfFun(this.operateUnit[0]) ? this.indexOfFun(this.operateUnit[0]) : '',
                         'balancePlan.cust_name': resultS,
                         'balancePlan.vehi_no': this.vehiNum,
                         'balancePlan.remark': this.remarks
                     })
                         .then(target => {
                             console.log(target);
                             if (target.data[0] === '-1') {
                                 this.$message.error(target.data[1]);
                             } else {
                                 this.$message.success(target.data[1]);
                                 this.getList();
                                 this.addModal = false;
                                 this.fangName = '';
                                 this.qiYong = [];
                                 this.addSchemes = [];
                                 this.dateTo = '';
                                 this.busType = [];
                                 this.balanceType = [];
                                 this.lineNames = [];
                                 this.classNum = '';
                                 this.operateUnit = [];
                                 this.vehiNum = [];
                                 this.remarks = '';
                                 this.addtype = '';
                                 this.closingUnit = '';
                             }
                         });
                }
            },
            indexOfFun(el){
                var indx1 = el.indexOf('[');
                var indx2 = el.indexOf(']');
                var result = el.substring(indx1 + 1, indx2);
                var resultEval = eval("(" + result + ")");
                console.log(resultEval);
                return resultEval;
            },
            addSureBtn1() {
                // this.revise = false;
                /*console.log(this.fangName1);
                console.log(this.lineNames1);
                console.log(this.qiYong1[0]);
                console.log(this.addSchemes1[0]);
                console.log(this.classNum1);
                console.log(this.vehiNum1);
                console.log(this.busType1[0]);
                console.log(this.balanceType1[0]);
                console.log(this.addtype1);
                console.log(this.startDateNew1);
                console.log(this.endDateNew1);
                console.log(this.operateUnit1[0]);
                console.log(this.remarks1);*/
                this.postRequest('/fin/balance/plan/update', {
                    'balancePlan.id': this.getId,
                    'copy_from': '',
                    'balancePlan.name': this.fangName1,
                    'balancePlan.is_enable': this.qiYong1[0],
                    'balancePlan.is_additional': this.addSchemes1[0],
                    'balancePlan.type': this.addtype1,
                    'balancePlan.start_date': this.startDateNew1,
                    'balancePlan.end_date': this.endDateNew1,
                    'balancePlan.balance_company_id': this.companyId,
                    'balancePlan.bus_type': this.busType1,
                    'balancePlan.balance_type': this.balanceType1[0],
                    'balancePlan.line_id': this.indexOfFun(this.lineNames1[0]) ? this.indexOfFun(this.lineNames1[0]) : '',
                    'balancePlan.line_name': this.lineNames1,
                    'balancePlan.bus_id': this.busId ? this.busId : '',
                    'balancePlan.cust_id': this.indexOfFun(this.operateUnit1[0]) ? this.indexOfFun(this.operateUnit1[0]) : '',
                    'balancePlan.cust_name': this.operateUnit1[0],
                    'balancePlan.vehi_no': this.vehiNum1,
                    'balancePlan.remark': this.remarks1
                })
                    .then(target => {
                        console.log(target);
                        if (target.data[0] === '-1') {
                            this.$message.error(target.data[1]);
                        } else {
                            this.$message.success(target.data[1]);
                            this.allList();
                            this.addModal = false;
                        }
                    });
            },
            allSearch(v1, v2, v3, v4, v5, v6, v7, v8) {
                this.postRequest('/fin/balance/plan/list', {
                    filterRules: JSON.stringify([
                        {"field": "fin_balance_plan.name", "op": "cn", "value": v1},
                        {"field": "type", "op": "cn", "value": v2},
                        {"field": "bus_type", "op": "cn", "value": v3},
                        {"field": "line_name", "op": "cn", "value": v4},
                        {"field": "bus_id", "op": "cn", "value": v5},
                        {"field": "cust_name", "op": "cn", "value": v6},
                        {"field": "vehi_no", "op": "cn", "value": v7},
                        {"field": "start_date", "op": "cn", "value": v8}
                    ]),
                    page: this.choosePage.currentPage,
                    rows: '10',
                })
                    .then(target => {
                        console.log(target);
                        var tag = target.data.list;
                        //页码大小
                        this.choosePage.pageSize = target.data.pageSize;
                        //页码数
                        this.choosePage.pageNumber = target.data.pageNumber;
                        //总页数
                        this.choosePage.total = target.data.totalRow;

                        this.chooseFruit = tag;
                    });
            },
            allSearch1(s1, s2, s3, s4) {
                this.postRequest('/sys/customdatescope/list', {
                    filterRules: JSON.stringify([
                        {"field": "name", "op": "cn", "value": s1},
                        {"field": "start_date", "op": "cn", "value": s2},
                        {"field": "end_date", "op": "cn", "value": s3},
                        {"field": "remark", "op": "cn", "value": s4},
                    ]),
                    page: this.choosePage1.currentPage,
                    rows: '10',
                    sort: 'name,start_date',
                    order: 'desc,asc'
                }).then(target => {
                    console.log(target);
                    var tag = target.data.list;
                    //页码大小
                    this.choosePage1.pageSize = target.data.pageSize;
                    //页码数
                    this.choosePage1.pageNumber = target.data.pageNumber;
                    //总页数
                    this.choosePage1.total = target.data.totalRow;

                    this.chooseFruit1 = tag;
                });
            },
            allSearch2(x1, x2, x3, x4) {
                this.postRequest('/fin/balance/company/list', {
                    filterRules: JSON.stringify([
                        {"field": "code", "op": "cn", "value": x1},
                        {"field": "name_short", "op": "cn", "value": x2},
                        {"field": "bankname", "op": "cn", "value": x3},
                        {"field": "bankno", "op": "cn", "value": x4}
                    ]),
                    page: this.choosePage2.currentPage,
                    rows: '10',
                }).then(target => {
                    console.log(target);
                    var tag = target.data.list;
                    //页码大小
                    this.choosePage2.pageSize = target.data.pageSize;
                    //页码数
                    this.choosePage2.pageNumber = target.data.pageNumber;
                    //总页数
                    this.choosePage2.total = target.data.totalRow;

                    this.chooseFruit2 = tag;
                });
            },
            allSearch3(u1, u2, u3, u4, u5) {
                this.postRequest('/fin/balance/fee/fees', {
                    filterRules: JSON.stringify([
                        {"field": "type", "op": "cn", "value": u1},
                        {"field": "name", "op": "cn", "value": u2},
                        {"field": "pay_type", "op": "cn", "value": u3},
                        {"field": "formula", "op": "cn", "value": u4},
                        {"field": "remark", "op": "cn", "value": u5}
                    ]),
                    page: this.choosePage3.currentPage,
                    rows: '10',
                }).then(target => {
                    console.log(target);
                    var tag = target.data.list;
                    //页码大小
                    this.choosePage3.pageSize = target.data.pageSize;
                    //页码数
                    this.choosePage3.pageNumber = target.data.pageNumber;
                    //总页数
                    this.choosePage3.total = target.data.totalRow;

                    this.chooseFruit3 = tag;
                });
            },
        },
        computed: {},
        watch: {
            dateTo(){
                this.startDateNew = this.dateTo[0];
                this.endDateNew = this.dateTo[1];
                console.log(this.dateTo);
            },
            dateTo1(){
                this.startDateNew1 = this.dateTo1[0];
                this.endDateNew1 = this.dateTo1[1];
                console.log(this.dateTo);
            },
            fanganName() {
                this.allSearch(this.fanganName, '', '', '', '', '', '', '');
            },
            fenlei() {
                this.allSearch('', this.fenlei, '', '', '', '', '', '');
            },
            classType() {
                this.allSearch('', '', this.classType, '', '', '', '', '');
            },
            lineNameM() {
                this.allSearch('', '', '', this.lineNameM, '', '', '', '');
            },
            banciNum() {
                this.allSearch('', '', '', '', this.banciNum, '', '', '');
            },
            yunying() {
                this.allSearch('', '', '', '', '', this.yunying, '', '');
            },
            cardNum() {
                this.allSearch('', '', '', '', '', '', this.cardNum, '');
            },
            youxiaoqi() {
                this.allSearch('', '', '', '', '', '', '', this.youxiaoqi);
            },
            mingcheng() {
                this.allSearch1(this.mingcheng, '', '', '');
            },
            dateS() {
                this.allSearch1('', this.dateS, '', '');
            },
            dateE() {
                this.allSearch1('', '', this.dateE, '');
            },
            beizhu() {
                this.allSearch1('', '', '', this.beizhu);
            },
            bianma() {
                this.allSearch2(this.bianma, '', '', '');
            },
            jiancheng() {
                this.allSearch2('', this.jiancheng, '', '');
            },
            kaihu() {
                this.allSearch2('', '', this.kaihu, '');
            },
            zhanghao() {
                this.allSearch2('', '', '', this.zhanghao);
            },
            leiBie() {
                this.allSearch3(this.leiBie, '', '', '', '');
            },
            feiYongM() {
                this.allSearch3('', this.feiYongM, '', '', '');
            },
            jiFei() {
                this.allSearch3('', '', this.jiFei, '', '');
            },
            gongSi() {
                this.allSearch3('', '', '', this.gongSi, '');
            },
            feiYongBeiZhu() {
                this.allSearch3('', '', '', '', this.feiYongBeiZhu);
            },
        },
        mounted() {
            this.getList();
            this.getYesOrNo();
            this.line();
            this.bus_company();
            this.bus_vehicle();
            this.getDateScopes();
            this.types();
            this.$emit("sendActive","5-3");
        }
    };
</script>
<style scoped src="../../assets/css/financeManage/accountFun.css"></style>
<style scoped>
</style>